<template>
  <div>
    <el-row>
      <el-col :span="4">
        <div class="grid-content bg-purple">

          <el-menu
              default-active="2"
              class="el-menu-vertical-demo"
              @open="handleOpen"
              @close="handleClose">
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>电影后台管理系统</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="1-1" @click="showComponents(1)">电影票购买</el-menu-item>
                <el-menu-item index="1-2" @click="showComponents(2)">电影订单</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
        </div>
      </el-col>
      <el-col :span="18">
        <div class="grid-content bg-purple-light">
          <Ticket v-show="tshow"></Ticket>
          <show-order v-show="oshow"></show-order>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import Ticket from "../components/Ticket";
import ShowOrder from "../components/ShowOrder";


export default {
  name: "Index",
  components: {ShowOrder, Ticket},
  data() {
    return {
      tshow: true,
      oshow: false
    }
  },
  methods: {
    handleOpen() {
      console.log('open')
    },
    handleClose() {
      console.log('关闭')
    },
    showComponents(tag) {
      if (tag == 1) {
        this.tshow = true
        this.oshow = false
      }
      if (tag == 2) {
        this.oshow = true
        this.tshow = false
      }
    }

  }
}
</script>

<style scoped>

</style>
